// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// This file defines the interface for Google Advanced Services and lists all
// publicly available Advanced Services that can be used in Apps Script projects.

/**
 * Google API Types
 */

// Also see:
// https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/appsscript.json

/**
 * Represents a Google Advanced Service that can be enabled in an Apps Script project.
 * @property {string} userSymbol - The symbol used to access the service in the script (e.g., "Drive", "Sheets").
 * @property {string} serviceId - The identifier for the service (e.g., "drive", "sheets").
 * @property {string} version - The version of the service to be used (e.g., "v3", "v4").
 */
export interface AdvancedService {
  readonly userSymbol: string;
  readonly serviceId: string;
  readonly version: string;
}

/**
 * This is a list of all public Advanced Services.
 *
 * It was generated by:
 * 1. script.google.com/create
 * 1. Resources > Advanced Google Services
 * 1. Enable all services
 * 1. View > Show manifest file
 * 1. View appsscript.json
 */
export const PUBLIC_ADVANCED_SERVICES: AdvancedService[] = [
  {
    userSymbol: 'AdminDirectory',
    version: 'directory_v1',
    serviceId: 'admin',
  },
  {
    userSymbol: 'AdminGroupsMigration',
    version: 'v1',
    serviceId: 'groupsmigration',
  },
  {
    userSymbol: 'AdminGroupsSettings',
    version: 'v1',
    serviceId: 'groupssettings',
  },
  {
    userSymbol: 'AdminLicenseManager',
    version: 'v1',
    serviceId: 'licensing',
  },
  {
    userSymbol: 'AdminReports',
    version: 'reports_v1',
    serviceId: 'admin',
  },
  {
    userSymbol: 'AdminReseller',
    version: 'v1',
    serviceId: 'reseller',
  },
  {
    userSymbol: 'AdSense',
    version: 'v2',
    serviceId: 'adsense',
  },
  {
    userSymbol: 'Analytics',
    version: 'v3',
    serviceId: 'analytics',
  },
  {
    userSymbol: 'AnalyticsAdmin',
    version: 'v1beta',
    serviceId: 'analyticsadmin',
  },
  {
    userSymbol: 'AnalyticsData',
    version: 'v1beta',
    serviceId: 'analyticsdata',
  },
  {
    userSymbol: 'AnalyticsReporting',
    version: 'v4',
    serviceId: 'analyticsreporting',
  },
  {
    userSymbol: 'Area120Tables',
    version: 'v1alpha1',
    serviceId: 'area120tables',
  },
  {
    userSymbol: 'BigQuery',
    version: 'v2',
    serviceId: 'bigquery',
  },
  {
    userSymbol: 'Calendar',
    version: 'v3',
    serviceId: 'calendar',
  },
  {
    userSymbol: 'Chat',
    version: 'v1',
    serviceId: 'chat',
  },
  {
    userSymbol: 'Classroom',
    version: 'v1',
    serviceId: 'classroom',
  },
  {
    userSymbol: 'Docs',
    version: 'v1',
    serviceId: 'docs',
  },
  {
    userSymbol: 'DoubleClickCampaigns',
    version: 'v4',
    serviceId: 'dfareporting',
  },
  {
    userSymbol: 'Drive',
    version: 'v3',
    serviceId: 'drive',
  },
  {
    userSymbol: 'DriveActivity',
    version: 'v2',
    serviceId: 'driveactivity',
  },
  {
    userSymbol: 'DriveLabels',
    version: 'v2beta',
    serviceId: 'drivelabels',
  },
  {
    userSymbol: 'Gmail',
    version: 'v1',
    serviceId: 'gmail',
  },
  {
    userSymbol: 'People',
    version: 'v1',
    serviceId: 'peopleapi',
  },
  {
    userSymbol: 'Sheets',
    version: 'v4',
    serviceId: 'sheets',
  },
  {
    userSymbol: 'ShoppingContent',
    version: 'v2.1',
    serviceId: 'content',
  },
  {
    userSymbol: 'Slides',
    version: 'v1',
    serviceId: 'slides',
  },
  {
    userSymbol: 'TagManager',
    version: 'v2',
    serviceId: 'tagmanager',
  },
  {
    userSymbol: 'Tasks',
    version: 'v1',
    serviceId: 'tasks',
  },
  {
    userSymbol: 'WorkspaceEvents',
    version: 'v1',
    serviceId: 'workspaceevents',
  },
  {
    userSymbol: 'YouTube',
    version: 'v3',
    serviceId: 'youtube',
  },
  {
    userSymbol: 'YouTubeAnalytics',
    version: 'v1',
    serviceId: 'youtubeAnalytics',
  },
  {
    userSymbol: 'YouTubeContentId',
    version: 'v1',
    serviceId: 'youtubePartner',
  },
];
